#ifndef EEEQT_H
#define EEEQT_H

#include <QDialog>
#include <QSystemTrayIcon>
#include <QGroupBox>
#include "eeeinterface.h"


class QCheckBox;
class QLabel;
class QPushButton;
class QSpacerItem;
class QSpinBox;
class QLCDNumber;
class QFrame;
class QHBoxLayout;
class QVBoxLayout;
class QTimer;
class QAction;
class QMenu;
class QStatusBar;

class eeeMain : public QDialog
{
   Q_OBJECT
     
 public:
   eeeMain(QWidget *parent = 0);
   // creates an eeeIface to get/set data from the eee.ko module
   eeeIface myIface;
   
 protected:
   void closeEvent(QCloseEvent *event);
   
 private slots:
   void fanControlToggle(bool);
   void tempWarningToggle(bool);
   void sysTrayToggle(bool);
   void iconActivated(QSystemTrayIcon::ActivationReason reason);
   void eeeRestore();
   void aboutShow();
   void updateLcd();
   void applySettings();
   void setDefaults();
   
 private:
   void createMainWidgets();
   void createSystemTray();
   void createConnections();
   void setStartupValues();
   void baloonWarningShow(int temp);
   bool isRoot();
   
   // Holds Everything
   QVBoxLayout *mainLayout;
   // Top Label
   QLabel *mainLabel;
   // Holds lcd monitors
   QHBoxLayout *lcdLayout;
   QLabel *rpmLabel;
   QLCDNumber *rpmLcd;
   QSpacerItem *lcdSpacerLeft;
   QLabel *tempLabel;
   QLCDNumber *tempLcd;
   QSpacerItem *lcdSpacerRight;
   QLabel *mhzLabel;
   QLCDNumber *mhzLcd;
   // Line between top widgets and bottom
   QFrame *lineTop;
   // Bottom Layout
   QHBoxLayout *bottomLayout;
   // Holds Spinners
   QGroupBox *settingsGroupBox;
   QVBoxLayout *settingsLayout;
   
   QHBoxLayout *fsbLayout;
   QLabel *fsbLabel;
   QSpacerItem *fsbSpacer;
   QSpinBox *fsbSpin;
   
   QHBoxLayout *fanLayout;
   QLabel *fanLabel;
   QSpacerItem *fanSpacer;
   QSpinBox *fanSpin;
   
   QHBoxLayout *warnLayout;
   QLabel *warnLabel;
   QSpacerItem *warnSpacer;
   QSpinBox *warnSpin;
   
   QPushButton *settingsDefault;
   QSpacerItem *settingsSpacer;
   
   // Start the right layout
   QVBoxLayout *rightLayout;
   
   QCheckBox *fanCheck;
   QCheckBox *warnCheck;
   QCheckBox *trayCheck;
   
   QFrame *rightLine;
   
   QPushButton *applyButton;
   QPushButton *closeButton;
   QSpacerItem *rightSpacer;
   
   QStatusBar *statusBar;
   // End main dialog gui p's
   
   QTimer *timer;
   
   // Systray stuff
   QAction *restoreAction;
   QAction *aboutAction;
   QAction *quitAction;
   
   QMenu *trayIconMenu;
   QSystemTrayIcon *trayIcon;

   // keep track of stuff
   int warningOn;
   int warningTemp;
   int sysTrayOn;
   int fanOff;
   int curFsb;
   int fanPrev;
   int defFsb;
   int defFan;
};
#endif

